package com.sicau.smart_farmer.controller;

import com.sicau.smart_farmer.common.CommonConstants;
import com.sicau.smart_farmer.common.ResultVO;
import com.sicau.smart_farmer.entity.Certificate;
import com.sicau.smart_farmer.service.CertificateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Api(tags = "证书类型")
@Slf4j
@Controller
@RequestMapping(CommonConstants.CERTIFICATE_PREFIX)
public class CertificateController {

    @Autowired
    private CertificateService certificateService;


    @ApiOperation("获取所有的证书类型")
    @GetMapping(value = "/getAllCertificate")
    @ResponseBody
    public ResultVO getAllCertificate(){
        List<Certificate> allCertificate = certificateService.getAllCertificate();
        return ResultVO.SUCCESS(allCertificate);
    }

}
